# Minimum CMake required
cmake_minimum_required(VERSION 3.25)

# Project
project(protobuf-examples)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_subdirectory(messages)
foreach(example add_person list_people)
  set(${example}_SRCS ${example}.cc)
  set(executable_name ${example}_cpp)

  add_executable(${executable_name} ${${example}_SRCS})
  target_link_libraries(${executable_name} proto-message)
endforeach()